const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_qualitysafetysystemproject', {
    subjectid: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目id"
    },
    subjectname: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "项目名称"
    },
    subjecttype: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目类型"
    },
    subjectaddress: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "项目地址"
    },
    subjectnum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目监督登记号"
    },
    projecttotal: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "单位工程数量"
    },
    subjectregion: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "所在区县"
    },
    subjectarea: {
      type: DataTypes.DECIMAL(14,6),
      allowNull: true,
      comment: "总面积"
    },
    subjectcost: {
      type: DataTypes.DECIMAL(14,6),
      allowNull: true,
      comment: "总造价"
    },
    beginaate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "计划开工日期"
    },
    finishaate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "计划完工日期"
    },
    subjectstatus: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目状态"
    },
    bjman: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "报监人"
    },
    bjdate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "报监日期"
    },
    structtype: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "结构类型 框架框剪...."
    },
    subdistrict: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "街道办事处"
    },
    schedule: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "申报时项目进度"
    },
    createtime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "创建时间"
    },
    updatetime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间"
    },
    prjnum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目编号"
    },
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "是否删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    },
    standardProjectbidinfoId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "招投外键base_standard_projectbidinfo",
      field: 'standard_projectbidinfo_id'
    },
    originalqualityid: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "原质安监项目id"
    }
  }, {
    sequelize,
    tableName: 'base_qualitysafetysystemproject',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
